package view;

import java.awt.Font;







import javax.swing.JLabel;
import javax.swing.JPanel;

import model.College;
import model.Teacher;
import model.Users;



@SuppressWarnings("serial")
public class PanelLoadingScreen extends JPanel {

	private static PanelLoadingScreen single;

	private JLabel title = new JLabel("Loading..");
	private JLabel data = new JLabel("Alle gegevens juist ");
	private JLabel loading = new JLabel("Laden van alles...");
	



	private PanelLoadingScreen() {

		setBounds(0, 0, 860, 720);
		setLayout(null);
		
		data.setBounds(370, 265, 200, 25);
		loading.setBounds(370, 315, 200, 25);
		
		title.setBounds(200, 90, 600, 70);
		title.setFont(new Font("Serif", Font.BOLD, 50));

		add(data);
		add(loading);
		add(title);
		
		
	}
	public void loadAllData(){
		College.getInstance();
		Teacher.getInstance();
		Users.getInstance();
		loadNextScreen();
	}
	
	
	public void loadNextScreen(){
		Main_Frame mf = Main_Frame.getInstance();
		mf.remove(PanelLoadingScreen.getInstance());
		mf.add(PanelDASboard.getInstance());
		mf.repaint();
		mf.validate();
	}
	
	public static PanelLoadingScreen getInstance() {
		if (single == null) {
			single = new PanelLoadingScreen();
		}
		return single;
	}
}
